package com.bootdo.enums;

import lombok.Getter;

@Getter
public enum StatusEnum {

    USABLE(1, "TRUE"), UNUSABLE(0, "FALSE"),DESTROY(2,"销毁");
    ;
    private Integer code;
    private String msg;

    StatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    public static String getMsg(Integer code) {
        for (StatusEnum s : StatusEnum.values()) {
            if (s.getCode().equals(code) ) {
                return s.getMsg();
            }
        }
        return null;
    }
}
